<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpictureformatplugin.cpp -->
  <title>QPictureFormatPlugin Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPictureFormatPlugin</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPictureFormatPlugin Class</h1>
<!-- $$$QPictureFormatPlugin-brief -->
<p>The QPictureFormatPlugin class provides an abstract base for custom picture format plugins. <a href="#details">More...</a></p>
<!-- @@@QPictureFormatPlugin -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPictureFormatPlugin&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><p><b>This class is obsolete.</b> It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<ul>
<li><a href="qpictureformatplugin-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpictureformatplugin.html#QPictureFormatPlugin">QPictureFormatPlugin</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qpictureformatplugin.html#dtor.QPictureFormatPlugin">~QPictureFormatPlugin</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpictureformatplugin.html#installIOHandler">installIOHandler</a></b>(const QString &amp;<i>format</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpictureformatplugin.html#loadPicture">loadPicture</a></b>(const QString &amp;<i>format</i>, const QString &amp;<i>fileName</i>, QPicture *<i>picture</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpictureformatplugin.html#savePicture">savePicture</a></b>(const QString &amp;<i>format</i>, const QString &amp;<i>fileName</i>, const QPicture &amp;<i>picture</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPictureFormatPlugin-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The picture format plugin is a simple plugin interface that makes it easy to create custom picture formats that can be used transparently by applications.</p>
<p>Writing an picture format plugin is achieved by subclassing this base class, reimplementing the pure virtual functions <a href="qpictureformatplugin.html#loadPicture">loadPicture</a>(), <a href="qpictureformatplugin.html#savePicture">savePicture</a>(), and <a href="qpictureformatplugin.html#installIOHandler">installIOHandler</a>(), and exporting the class with the <a href="../qtcore/qtplugin.html#Q_PLUGIN_METADATA">Q_PLUGIN_METADATA</a>() macro.</p>
<p>The json file containing the metadata should contain one entry with the list of picture formats supported by the plugin:</p>
<pre class="cpp">

  { <span class="string">&quot;Keys&quot;</span>: <span class="operator">[</span> <span class="string">&quot;mypictureformat&quot;</span> <span class="operator">]</span> }

</pre>
</div>
<p><b>See also </b><a href="../qtdoc/plugins-howto.html">How to Create Qt Plugins</a>.</p>
<!-- @@@QPictureFormatPlugin -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPictureFormatPlugin[overload1]$$$QPictureFormatPluginQObject* -->
<h3 class="fn" id="QPictureFormatPlugin"><a name="QPictureFormatPlugin"></a>QPictureFormatPlugin::<span class="name">QPictureFormatPlugin</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an picture format plugin with the given <i>parent</i>. This is invoked automatically by the moc generated code that exports the plugin.</p>
<!-- @@@QPictureFormatPlugin -->
<!-- $$$~QPictureFormatPlugin[overload1]$$$~QPictureFormatPlugin -->
<h3 class="fn" id="dtor.QPictureFormatPlugin"><a name="dtor.QPictureFormatPlugin"></a><code>[virtual] </code>QPictureFormatPlugin::<span class="name">~QPictureFormatPlugin</span>()</h3>
<p>Destroys the picture format plugin.</p>
<p>You never have to call this explicitly. Qt destroys a plugin automatically when it is no longer used.</p>
<!-- @@@~QPictureFormatPlugin -->
<!-- $$$installIOHandler[overload1]$$$installIOHandlerconstQString& -->
<h3 class="fn" id="installIOHandler"><a name="installIOHandler"></a><code>[pure virtual] </code><span class="type">bool</span> QPictureFormatPlugin::<span class="name">installIOHandler</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>format</i>)</h3>
<p>Installs a QPictureIO picture I/O handler for the picture format <i>format</i>. Returns <code>true</code> on success.</p>
<!-- @@@installIOHandler -->
<!-- $$$loadPicture[overload1]$$$loadPictureconstQString&constQString&QPicture* -->
<h3 class="fn" id="loadPicture"><a name="loadPicture"></a><code>[virtual] </code><span class="type">bool</span> QPictureFormatPlugin::<span class="name">loadPicture</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>format</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>fileName</i>, <span class="type"><a href="qpicture.html">QPicture</a></span> *<i>picture</i>)</h3>
<p>Loads the picture stored in the file called <i>fileName</i>, with the given <i>format</i>, into *<i>picture</i>. Returns <code>true</code> on success; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qpictureformatplugin.html#savePicture">savePicture</a>().</p>
<!-- @@@loadPicture -->
<!-- $$$savePicture[overload1]$$$savePictureconstQString&constQString&constQPicture& -->
<h3 class="fn" id="savePicture"><a name="savePicture"></a><code>[virtual] </code><span class="type">bool</span> QPictureFormatPlugin::<span class="name">savePicture</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>format</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>fileName</i>, const <span class="type"><a href="qpicture.html">QPicture</a></span> &amp;<i>picture</i>)</h3>
<p>Saves the given <i>picture</i> into the file called <i>fileName</i>, using the specified <i>format</i>. Returns <code>true</code> on success; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qpictureformatplugin.html#loadPicture">loadPicture</a>().</p>
<!-- @@@savePicture -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
